<?php
		include_once '../php_idea_project/DefaultIcbcClient.php';
		include_once '../php_idea_project/IcbcConstants.php';
		#gw.dccnet.com.cn:8087
		$request = array(
		    "serviceUrl" => 'http://ip:port/api/cardbusiness/aggregatepay/b2c/online/sersuborder/V1',
		    "method" => 'POST',
		    "isNeedEncrypt" => false,
		    "biz_content" => array(
		        "mer_id"=>"200001490",
		        "mer_prtcl_no"=>"0200530106250201",
		        "icbc_appid"=>"10000000000004095503",
		        "order_num"=>"2",
		        "order_submit_act_input"=>
		            array(
		                array(
		                    "rec_num"=>"1",
		                    "oper_flag"=>"0",
		                    "sub_order_id"=>"22222221",
		                    "busi_type"=>"2",
		                    "seq_no"=>"020001040311000512005200006005",
		                    "ori_trx_date"=>"2020-09-21",
		                    "sub_mer_id"=>"020001040336",
		                    "sub_mer_prtcl_no"=>"0200010403360201",
		                    "classify_amt"=>"1",
		                    "term_id"=>"",
												"mer_acct":"0200092109050001179",//需要直接分账的商户清算账号 
												"mer_sp_infor":"zhp3"//商户自定义信息 
		                ),
		                array(
		                    "rec_num"=>"2",
		                    "oper_flag"=>"0",
		                    "sub_order_id"=>"2222222331",
		                    "busi_type"=>"2",
		                    "seq_no"=>"020001040311000512005200006005",
		                    "ori_trx_date"=>"2020-09-21",
		                    "sub_mer_id"=>"020001040336",
		                    "sub_mer_prtcl_no"=>"0200010403360201",
		                    "classify_amt"=>"1",
		                    "term_id"=>"",
												"mer_acct":"0200092109050001179",//需要直接分账的商户清算账号 
												"mer_sp_infor":"zhp3"//商户自定义信息 
		                )
		            )
		    )

		);
		//以下构造函数第1个参数为appid，第2个参数为RSA密钥对中私钥，第6个参数为API平台网关公钥
		$client = new DefaultIcbcClient('10000000000004095503',
		    ' MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDYLo0htdHwedbvoJA0o5AA/UUE1zb/J4OO9SYmeMBZnLeiNC7TwG53PXgwCSHsp2gM02QatfohUUDHQJg/ezYCSDSMoWfYKv/dfz0DlXp1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7p2zLI1eo7UpMURf1/FOakJgubuO571bEALJfK++912FRQbiQKBgEw15FwJSUif0MeZRohZomudbWR19OiQEhFiUoptyVL2Kov7hFIEjHIqYHkGxXeJGNRoNzfxoR+ywg8GKK8Fq3dmigkB4hL+YjyBnxX0SouyLoWUZ0Jvsurr9bZ5h/qvPyLhtCQyc7QXM4fBKlOy0rxgOBIxRWKMVvJeFHEqw6SBAoGAPuR/+v2VCePORhobY0EIIRLK1sO+Q2IVJIU4ecm0irD99/uwEc+RgJF0IakYlrw1PtmhDYniXO07GMIecj4zsnnPZtkttoNxmikMrK51YsFcsz8I55XzRPPGj1V8CxpfRxmEj9ofyHYHDDvSoHAR28xJdubbn3PuB7nBp94yNWk=',
		    IcbcConstants::$SIGN_TYPE_RSA,
		    '',
		    '',
		    'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03ctKM7KV+16bWZ5BMNgvEeuEQwfQYkRVwI9HFOGkwNTMn5hiJXHnlXYCX+zp5r6R52MY0O7BsTCLT7aHaxsANsvI9ABGx3OaTVlPB59M6GPbJh0uXvio0m1r/lTW3Z60RU6Q3oid/rNhP3CiNgg0W6O3AGqwIDAQAB',
		    '',
		    '',
		    '',
		    '');
		try{
		    $resp = $client->execute($request,'123131123876111','');//执行调用;msgId消息通讯唯一编号，要求每次调用独立生成，APP级唯一
		    echo $resp;
		    $respObj = json_decode($resp,true);
		    if($respObj["return_code"] == 0){ //sucess
		        echo $respObj["return_msg"];
		    }else{//fail
		        echo $respObj["return_msg"];
		    }
		}catch (Exception $e){
		    echo 'Exception:'.$e->getTrace().$e->getMessage()."\n";
		}

?>